# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023/10/22
desc: 
sample: 
"""
import json

a="20"
b=20
print(type(a))
print(type(b))
data =int(a)*3
print(data)

#list
print('list------------')
array1=['1','2','3','1']
array1.append('4')
array1 = set(array1)
print(type(array1),array1)
#元组
print('tuple------------')
array2=('1','2','3','1')
print(type(array2))
print(array2)
try:
    array2.append('34334')  # 出异常 后面代码不执行 加 try except
except:
    pass

#不容许重复
print('set------------')
array3={'1','2','3','1'}
print(type(array3))
print(array3)


print('dict------------')
person ={
  "name": "张三",
  "age": 25,
  "lunch_fee": 19.5,
  "hope_deposit": 10000000000000,
  "dream_come": True
}

print(person.get('name','默认值'))
for item in person.items():
    print(item)



myjson = {
    "list" : [
        {
            "name": "Apifox",
            "ID": 2,
            "city": "Guangzhou"
        }
    ]
}
print(type(myjson))


json_string = '{"name": "John", "age": 30, "city": "New York"}'
#json_string.get('name')
print(type(json_string))
json_dict = json.loads(json_string)
print(type(json_dict))
print(json_dict.get('name'))
#数据库 字符串
json_str= json.dumps(json_dict)
print(type(json_str))

print("测试")


